<template>
      
  <div class="">
    <div class="box">
      <div class="boxTop">
        <p @click="gotos">精选专题</p>
        <i><van-icon name="arrow" /></i>
      </div>
      <ul>
        <li v-for="item in list" :key="item.id">
          <img :src="item.pic" alt="" />
          <!-- <p class="title">{{ item.title }}</p>
          <p class="descript">{{ item.descript }}</p> -->
          <p v-html="item.title" class="title"></p>
          <p v-html="item.descript" class="descript"></p>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import { getlists } from "../utils/api/home.js";

export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    getlists().then((res) => {
      console.log(res);
      this.list = res.data.data;
    });
  },
  methods: {
    gotos() {
      this.$router.push("/strict");
    },
  },
};
</script>

<style lang='scss' scoped>
.box {
  position: relative;
  height: 6.2rem;
  border-bottom: 0.2rem solid #f5f5f5;

  .boxTop {
    margin-top: 0.2rem;
    padding-left: 2.76rem;
    padding-right: 2.76rem;
    height: 0.9rem;
    position: absolute;
    top: 0;
    display: flex;
    line-height: 0.9rem;
    p {
      display: block;
      font-size: 0.38rem;
    }
    i {
      font-size: 0.38rem;
    }
  }
  ul {
    width: 100%;
    display: flex;
    overflow-x: auto;
    position: absolute;
    bottom: 0;
    left: 0;
    padding-top: 0.4rem;
    padding-bottom: 0.2rem;
    li {
      width: 6.4rem;
      margin-left: 0.12rem;
      img {
        width: 6.38rem;
        height: 4.08rem;
        border-radius: 5%;
      }
      .title {
        font-size: 0.3rem;
      }
      .descript {
        width: 80%;
        font-size: 0.23rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        color: #a8a8a8;
      }
    }
  }
}
</style>
